package com.apimarket.entity.kong;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Date;
import java.util.List;

/**
 * Kong中消费者绑定Acl插件的凭证实体
 *
 * @author yyc
 */
public class AclCredential {
    private String id;

    private String group;

    @JsonProperty("created_at")
    private Date createdAt;

    private Consumer consumer;

    /**
     * 作用不明，只为适配json转换
     */
    private List<String> tags;

    public AclCredential() {
    }

    public class Consumer {
        private String id;

        public Consumer() {
        }

        public Consumer(String id) {
            this.id = id;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder("Consumer{");
            sb.append("id='").append(id).append('\'');
            sb.append('}');
            return sb.toString();
        }
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Consumer getConsumer() {
        return consumer;
    }

    public void setConsumer(Consumer consumer) {
        this.consumer = consumer;
    }

    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("AclCredential{");
        sb.append("id='").append(id).append('\'');
        sb.append(", group='").append(group).append('\'');
        sb.append(", createdAt=").append(createdAt);
        sb.append(", consumer=").append(consumer);
        sb.append('}');
        return sb.toString();
    }
}
